﻿using System;
using System.IO;
using System.Collections.Generic;
using AttachmentModule.Dime;
using System.Xml;
using Coordenadas;
using System.Windows.Forms;
namespace LectorXML
{
    public class XMLLlamadosLocal:XMLLlamados
    {
        private Central.Central proxy;
        XmlDocument xdoc;

        public XMLLlamadosLocal(string url)
        {
             proxy = new Central.Central(url);
        }

        public XmlDocument XML()
        {
            XmlNode xn = this.proxy.Llamados();
            xdoc = new XmlDocument();
            xdoc.ImportNode(xn, true);
            return this.xdoc;
        }

        public XmlNodeList Llamados()
        {
            XmlNode xn;
            try
            {
                xn = this.proxy.Llamados();
            }
            catch (Exception)
            {
                try
                {
                    xn = this.proxy.Llamados();
                }
                catch (Exception)
                {
                    xn = null;
                    return null;
                }
            }
            return xn.SelectNodes("//llamado");
        }
        public XmlNode Llamado(string numero)
        {
            return this.proxy.LlamadoGET(numero);
        }
    }
}
